/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 2.0
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */
define(["exports","./Matrix3-80f44511","./Matrix2-f9a8df5e","./Check-de3c6afc","./defaultValue-15342b8e","./Math-30274b8d"],(function(n,e,a,t,r,i){"use strict";function s(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}s.fromPointNormal=function(n,a,t){const i=-e.Cartesian3.dot(a,n);return r.defined(t)?(e.Cartesian3.clone(a,t.normal),t.distance=i,t):new s(a,i)};const o=new e.Cartesian3;s.fromCartesian4=function(n,a){const t=e.Cartesian3.fromCartesian4(n,o),i=n.w;return r.defined(a)?(e.Cartesian3.clone(t,a.normal),a.distance=i,a):new s(t,i)},s.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const c=new e.Cartesian3;s.projectPointOntoPlane=function(n,a,t){r.defined(t)||(t=new e.Cartesian3);const i=s.getPointDistance(n,a),o=e.Cartesian3.multiplyByScalar(n.normal,i,c);return e.Cartesian3.subtract(a,o,t)};const l=new a.Matrix4,f=new a.Cartesian4,d=new e.Cartesian3;s.transform=function(n,t,r){const i=n.normal,o=n.distance,c=a.Matrix4.inverseTranspose(t,l);let C=a.Cartesian4.fromElements(i.x,i.y,i.z,o,f);C=a.Matrix4.multiplyByVector(c,C,C);const u=e.Cartesian3.fromCartesian4(C,d);return C=a.Cartesian4.divideByScalar(C,e.Cartesian3.magnitude(u),C),s.fromCartesian4(C,r)},s.clone=function(n,a){return r.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new s(n.normal,n.distance)},s.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},s.ORIGIN_XY_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_Z,0)),s.ORIGIN_YZ_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_X,0)),s.ORIGIN_ZX_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_Y,0)),n.Plane=s}));
